
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta mobile="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="./adaptive.js"></script>
    <script src="./jq.js"></script>
    <title>邀请好友</title>
    <link id="mobile-style" media="only screen and (max-width: 767px)" type="text/css" rel="stylesheet" href="wx/wx.css" />
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        .invite-page {
            position: relative;
            width: 100vw;
            min-height: 100vh;
            background: linear-gradient(to bottom, #360F18, #3B0001);
            overflow-x: hidden;
        }
        .rule-button {
            position: absolute;
            right: 0;
            top: 1.3rem;
            width: 1rem;
            height: .5rem;
            background: #7A7A7A;
            color: #fff;
            font-size: 13px;
            text-align: center;
            line-height: .5rem;
            border-top-left-radius: 15px;
            border-bottom-left-radius: 15px;
            z-index: 2;
        }
        .page-bg {
            position: relative;
            top: 0rem;
            width: 7.5rem;
            height: 8.79rem;
            background: url('./images/invite_page_bg.png') no-repeat;
            background-size: contain;
        }
        .page-bg .title {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            top: .4rem;
            width: 5.65rem;
            height: .79rem;
            background: url('./images/title.png') no-repeat;
            background-size: contain;
        }
        .page-bg .football {
            position: absolute;
            right: .02rem;
            top: 4.8rem;
            width: 1.90rem;
            height: 1.93rem;
            background: url('./images/football.png') no-repeat;
            background-size: contain;
        }
        .page-bg .packet {
            position: absolute;
            width: 7.05rem;
            height: 4.37rem;
            top: 5.8rem;
            left: .3rem;
            background: url('./images/packet_left.png') no-repeat;
            background-size: contain;
        }
        /* .page-bg .right-packet {
            right: .3rem;
            left: auto;
            background-size: contain;
        } */
        .invite-bg {
            position: relative;
            margin-top: 2rem;
            width: 7.5rem;
            height: 5.65rem;
            background: url('./images/invite_bg.png') no-repeat;
            background-size: contain;
        }
        .invite-bg .invite-btn {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            top: -.65rem;
            width: 6.92rem;
            height: 1.3rem;
            background: url('./images/invite_btn.png') no-repeat;
            background-size: contain;
        }
        .invite-bg .invite-log {
            position: absolute;
            width: 6.89rem;
            height: 3.61rem;
            left: 50%;
            transform: translateX(-50%);
            top: 1.5rem;
            background: url('./images/invite_log.png') no-repeat;
            background-size: contain;
        }
        .invite-bg .invite-log span {
            position: absolute;
            color: #FB0000;
            font-size: 18px;
            bottom: .9rem;
            left: 1.5rem;
        }
        .invite-bg .invite-log .money-invite {
            left: 4.8rem;
        }
        .invite-list {
            position: relative;
            width: 7.5rem;
            /* height: 10rem; */
            background: #FFFFFF;
            padding-top: .2rem;
        }
        .invite-list .list-title {
            margin: 0 auto .2rem;
            width: 5.21rem;
            height: .34rem;
            background: url('./images/list_title.png') no-repeat;
            background-size: contain;
        }
        .invite-list .list-info {
            width: 7.5rem;
            height: .8rem;
            display: flex;
            align-items: center;
            justify-content: space-around;
            background: #F6F4F8;
            font-size: 14px;
            color: #6D6D6D;
        }
        .invite-list .list-info .mobile {
            width: 1.4rem;
            text-align: center;
        }
        .invite-list .list-info .order {
            width: .5rem;
            text-align: center;
            white-space: nowrap;
        }
        .invite-list .list-info .money {
            width: .7rem;
            text-align: center;
            white-space: nowrap;
        }
        .invite-list .list-content {
            width: 7.5rem;
        }
        .invite-list .list-content ul li {
            height: .9rem;
            display: flex;
            align-items: center;
            justify-content: space-around;
            font-size: 13px;
            color: #333333;
            border-bottom: 1px solid #F0F0F0;
        }
        .invite-list .list-content ul li:nth-child(1) span:nth-child(1) {
            width: .5rem;
            height: .62rem;
            background: url('./images/first.png') no-repeat;
            background-size: contain;
        }
        .invite-list .list-content ul li:nth-child(2) span:nth-child(1) {
            width: .5rem;
            height: .62rem;
            background: url('./images/second.png') no-repeat;
            background-size: contain;
        }
        .invite-list .list-content ul li:nth-child(3) span:nth-child(1) {
            width: .5rem;
            height: .62rem;
            background: url('./images/third.png') no-repeat;
            background-size: contain;
        }
        .invite-list .list-content ul li span:nth-child(1) {
            width: .5rem;
            text-align: center;
        }
        .invite-list .list-content ul li span:nth-child(2) {
            width: 1.4rem;
            text-align: center;
            white-space: nowrap;
        }
        .invite-list .list-content ul li span:nth-child(3) {
            width: .7rem;
            text-align: center;
            white-space: nowrap;
        }
        .rule-wrapper {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, .5);
            z-index: 3;
            display: none;
        }
        .rule-wrapper .rule-box {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 6rem;
            height: 7.5rem;
            background: #fff;
            border-radius: 8px;
            padding-top: .3rem;
        }
        .rule-wrapper .rule-box .title {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            width: 3.79rem;
            height: .57rem;
            background: url('./images/rule_title.png') no-repeat;
            background-size: contain;
        }
        .rule-wrapper .rule-box .close-button {
            position: absolute;
            top: -.25rem;
            right: -.25rem;
            width: .54rem;
            height: .57rem;
            background: url('./images/close_btn.png') no-repeat;
            background-size: contain;
        }
        .rule-wrapper .rule-box .rule-content {
            position: absolute;
            top: 55%;
            left: 51%;
            transform: translate(-50%, -50%);
            width: 5.18rem;
            height: 5.55rem;
            background-size: contain;
        }
        .rule-wrapper .rule-box .rule-content p{
            font-size:14px;
        }
 body > a {
            display: none;
        }
            
    </style>
</head>
<body>
    <script>
        window['adaptive'].designWidth = 750;
        window['adaptive'].baseFont = 24;
        window['adaptive'].scaleType = 1;
        // 初始化
        window.adaptive.init();
    </script>
    <div class="invite-page">
        <div class="rule-button">规则</div>
        <div class="page-bg">
            <div class="football"></div>
            <div class="packet left-packet"></div>
            <!-- <div class="packet right-packet"></div> -->
        </div>
        <div class="invite-bg">
            <div class="invite-btn"></div>
            <div class="invite-log">
                <span class="person-invite"></span>
                <span class="money-invite"></span>
            </div>
        </div>
        <div class="invite-list">
            <div class="list-title"></div>
            <div class="list-info">
                <span class="order">排名</span>
                <span class="mobile">用户名</span>
                <span class="money">人数</span>
            </div>
            <div class="list-content">
                <ul id="list">
                </ul>
            </div>
        </div>
        <div class="rule-wrapper">
            <div class="rule-box">
                <div class="title"></div>
                <div class="rule-content">
                    <p>1、邀请的好友仅限注册用户（手机号）未注册过；</p>
                    <p>2、一个设备只能被邀请一次；</p>
                    <p>3、推荐人必须为已购彩用户，推荐好友数不设上限；</p>
                    <p>4、被推荐好友下载注册后，消费满2元，即为推荐成功；</p>
                    <p>5、如发现恶意作弊行为，将冻结账户，并保留追究权利；</p>
                    <p>6、本次活动最终解释权归蓝胖足球所有。</p>
                    <p></p>
                </div>
                <div class="close-button"></div>
            </div>
        </div>
    </div>
<div id='weixin-tip-wrapper'>
<div id='weixin-tip-box'>
        <div class="triangle_border_up">
            <span></span>
        </div>
        <div class="weixin-tip">
            <p>
                请点击右上角
            </p>
            <p class="content">
                选择"浏览器中打开"
            </p>
        </div>
</div>
</div>

    <script>
        var userId = null;
        var domain = 'http://39.98.47.61:18882';
        var commonParams = {
            appKey: 'LOVE-LOTTERY',
            channel: 'h5',
            source: 3,
        };
        var rank = [
            {
                order: 1,
                mobile: '177****6785',
                money: 700
            },
            {
                order: 2,
                mobile: '177****6785',
                money: 700
            },
            {
                order: 3,
                mobile: '177****6785',
                money: 700
            },
            {
                order: 4,
                mobile: '177****6785',
                money: 700
            },
            {
                order: 5,
                mobile: '177****6785',
                money: 700
            },
            {
                order: 6,
                mobile: '177****6785',
                money: 700
            }
        ]
        var rankList = [];
        // 获取链接中的userId
        window.location.search.replace('?', '').split('&').map(item => {
            if(item.indexOf('user') > -1) {
                userId = item.split('=')[1];
            }
        })
        let data = Object.assign(commonParams, {userId: userId})
        $.post(domain + '/apiActivity/userActivity', data, function (res) {
            var data = res.data ||{}
            $('.person-invite')[0].innerHTML = data.inviteNum || 0;
            $('.money-invite')[0].innerHTML = data.brokerage || 0;
        })
        $.post(domain + '/apiActivity/inviteRank', data, function (res) {
            rankList = res.data.moneyList || rank;
            let html = '';
            rankList.forEach((item, index) => {
                html += `<li>
                        <span>${index > 2 ? index + 1 : ''}</span>
                        <span>${item.mobile}</span>
                        <span>${item.money}</span>
                    </li>`
            })
            document.getElementById('list').innerHTML = html;
        })
        // 点击规则
        $('.rule-button')[0].onclick = function () {
           $('.rule-wrapper')[0].style.display = 'block';
        }
        // 点击关闭按钮
       $('.close-button')[0].onclick = function () {
            $('.rule-wrapper')[0].style.display = 'none';
        }
        // 点击立即邀请
        $('.invite-btn')[0].onclick = function () {
            window.location.href = './share.html?userId=' + userId+'&source=invite';
        }
    </script>
<script type="text/javascript" src="https://s4.cnzz.com/z_stat.php?id=1278260129&web_id=1278260129"></script>
<SCRIPT src="./wx.js?v=133" type=text/javascript></SCRIPT>
</body>
</html>
